package com.tencent.iov.cowin.befsale.clue.repository.cus.impl;

import com.github.pagehelper.Page;
import com.tencent.iov.cowin.befsale.clue.controller.cus.vo.request.ClueIntentionGradeDataRequest;
import com.tencent.iov.cowin.befsale.clue.dao.cus.DealerCustomerFollowPlanDao;
import com.tencent.iov.cowin.befsale.clue.domain.cus.po.DealerCustomerFollowPlan;
import com.tencent.iov.cowin.befsale.clue.repository.cus.DealerCustomerFollowPlanManager;
import com.tencent.iov.cowin.befsale.clue.value.contants.ServiceConstant;
import com.software.boot.dao.annotation.TargetDataSource;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @Describe: 经销商跟进线索表_Manager实现层
 * @author: xiamu
 * @created: 2021-12-21 17:29:54
 * @version: 1.0
 */
@Service
public class DealerCustomerFollowPlanManagerImpl implements DealerCustomerFollowPlanManager {

    @Autowired
    private DealerCustomerFollowPlanDao dealerCustomerFollowPlanDao;


    @Override
    @TargetDataSource(ServiceConstant.QW_SALE_READ)
    public DealerCustomerFollowPlan getDetailById(Long id) {
        return dealerCustomerFollowPlanDao.getDetailById(id);
    }

    @Override
    @TargetDataSource(ServiceConstant.QW_SALE_WRITE)
    public int insert(DealerCustomerFollowPlan request) {
        return dealerCustomerFollowPlanDao.insert(request);
    }

    @Override
    @TargetDataSource(ServiceConstant.QW_SALE_WRITE)
    public int insertBatch(List<DealerCustomerFollowPlan> requests) {
        return dealerCustomerFollowPlanDao.insertBatch(requests);
    }

    @Override
    @TargetDataSource(ServiceConstant.QW_SALE_WRITE)
    public int update(DealerCustomerFollowPlan request) {
        return dealerCustomerFollowPlanDao.update(request);
    }

    @Override
    @TargetDataSource(ServiceConstant.QW_SALE_WRITE)
    public int delete(Integer id) {
        return dealerCustomerFollowPlanDao.delete(id);
    }

    @Override
    @TargetDataSource(ServiceConstant.QW_SALE_READ)
    public List<DealerCustomerFollowPlan> getListByParam(DealerCustomerFollowPlan request) {
        return dealerCustomerFollowPlanDao.getListByParam(request);
    }

    @Override
    @TargetDataSource(ServiceConstant.QW_SALE_READ)
    public Page<DealerCustomerFollowPlan> getPageByParam(DealerCustomerFollowPlan request, RowBounds rowBounds) {
        return dealerCustomerFollowPlanDao.getPageByParam(request, rowBounds);
    }

    @Override
    @TargetDataSource(ServiceConstant.QW_SALE_READ)
    public DealerCustomerFollowPlan getOneByParam(DealerCustomerFollowPlan request) {
        return dealerCustomerFollowPlanDao.getOneByParam(request);
    }

    /**
     * 根据条件统计计划表数量
     * add by zly
     * @param clueIntentionGradeDataRequest
     * @return
     */
    @Override
    public Integer getFollowUpData(ClueIntentionGradeDataRequest clueIntentionGradeDataRequest) {
        return dealerCustomerFollowPlanDao.getFollowUpData(clueIntentionGradeDataRequest);
    }
}
